<?php

class Domain_Account {

    private $model;

    public function __construct()
    {
        $this->model = new Model_Account();
    }

    function getUserInfo($userId){
        return $this->model->getUserInfo($userId);
    }

    public function addAccount($userId,$note)
    {
        $data = array(
            'note' => $note,
            'user_id' => $userId,
            'record_stamp'=> time(),
        );
        $rs = $this->model->addAccount($data);
        return ($rs)? $rs : 0;
    }

    public function addAccountDetail($accountId,$cateId,$amount){
        $model = new Model_Account();
        $data = array(
            'account_id'=>$accountId,
            'category_id'=>$cateId,
            'amount'=>$amount,
            'record_stamp'=> time(),
        );
        return $model->addAccountDetail($data);
    }
}


 ?>
